<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文章版本控制对话框</title>
<style>
body{font-size:12px}
ul,li{list-style:none;margin-left:0}
li{width:25%;float:left}
</style>
<script type="text/javascript" src="/include/manage/js/jquery.js"></script>
<script language="javascript">
jQuery.ajaxSetup ({
	cache: false
});

<!--模态窗口-->
 function showModalWindow(versionid){
	//var width  = screen.width+100;
  	//var height = screen.height;
	var width  = 1150;
	var height = 700;
  	var leftm  = 0;
 	var topm   = 0;
 	var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=0, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;
	var url="/manage_news_ajax.ad?parameter=editNewsVersion&versionid="+versionid+"&newsid=$!news.id";
   window.showModalDialog(url,window,'dialogWidth:950px;dialogHeight:600px');
 }
 
 function update() 
 { 
  //oColor.innerText = sColor; 
  window.location="/manage_news_ajax.ad?parameter=newsVersion&newsid=$!news.id&tid=$!news.type";
 } 
<!--模态窗口-->

</script>
</head>
<body>
	<div id="dialog">
	<br/>
	<!--<form id="delform" name="delform" action="/manage_news_ajax.ad" method="post">-->
		<input type="hidden" name="parameter" value="delete" />
		<input type="hidden" id="deleteid" name="id" value="" />
    	<table  width="95%" bgcolor="#b5d6e6">
			<thead><tr><td colspan="6">"$!news.title" 的版本号如下：</td></tr></thead>

			<tr><td width="32" background="/include/manage/images/main/bg.gif"><div align="center"><label for="selAll">选择</label></div></td>
			<td width="40" background="/include/manage/images/main/bg.gif"><div align="center">版本号</div></td>
			<td width="*" background="/include/manage/images/main/bg.gif"><div align="center">版本说明</div></td>
			<td width="130" background="/include/manage/images/main/bg.gif"><div align="center">创建时间</div></td>
			<td width="60" background="/include/manage/images/main/bg.gif"><div align="center">创建人</div></td>
			<td width="150" background="/include/manage/images/main/bg.gif"><div align="center">操作</div></td></tr>
			#foreach($aversion in $versionList)
				<tr><td height="20" bgcolor="#FFFFFF"><div align="center">
				  <input type="checkbox" name="sel_vnum" value="$!aversion.id" />
				</div></td>
				<td bgcolor="#FFFFFF">$!aversion.versionnumber</td>
				<td bgcolor="#FFFFFF">$!aversion.description</td>
				<td bgcolor="#FFFFFF">$!aversion.date</td>
				<td bgcolor="#FFFFFF">$!aversion.author</td>
				<td bgcolor="#FFFFFF" align="center"><a href="javascript:deleteNewsVersion('$!aversion.id')"><font color="green" >删除&nbsp;&nbsp;</font></a>  <a href="#" onclick="showModalWindow('$!aversion.id')"><font color="green">查看&nbsp;&nbsp;</a>     #if($pop==0 && $news.display==1)
            	无恢复权限 #else <a href="javascript:BackNewsVersion('$!aversion.id')"><font color="green">恢复</font></a>#end</td></tr>
			#end
		</table>
	<!--</form>-->
			<br/>
			<br/>
	说明：<input id="description" type="text" name="description" vaule=""/>
					<input id="ver" type="button" name="ver" onclick="saveNewsVersion('$news.id')" value="保存当前内容为一个新的版本"/>
    </div>
</body>
<script language="javascript">

function deleteNewsVersion(versionid){
	if(confirm('确定要删除吗?')){
		jQuery.get("/manage_news_ajax.ad" , { parameter : "delNewsVersion", versionid : versionid,newsid:"$news.id"},function(data){
			window.location.reload();
		});
		/*
		var new_url ="/manage_news_ajax.ad?parameter=delete&id="+versionid;
		window.location.href=new_url;
		//window.location.reload();
		*/
	}
}
function BackNewsVersion(versionid){
	if(confirm('确定要启用此版本吗?')){
		jQuery.get("/manage_news_ajax.ad" , { parameter : "backNewsVersion", versionid : versionid,newsid:"$news.id"},function(data){
			window.location.reload();
		});
	}
}

function saveNewsVersion(){
	//alert(document.getElementById('description').value);
	
	var descr = document.getElementById('description').value;
	jQuery.get("/manage_news_ajax.ad" , { parameter : "addNewsVersion", newsid : "$news.id" ,description: descr},function(data){
		window.location.reload();
	});
	/*  
	alert($('#description').val()); 总是显示undefined，下面的链接无反应
	var new_url ="/manage_news_ajax.ad?parameter=addNewsVersion&newsid="+newsid+"&description="+document.getElementById('description').value;
	window.location.herf=new_url;
	*/
}
</script>
</html>